/* $Id:chat_window.h jjs $ */
/*
   Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
   Part of the Moros Project http://moros.sourceforge.net/

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License.
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY.

   See the COPYING file for more details.
*/

#ifndef CHAT_WINDOW_H
#define CHAT_WINDOW_H

#include <gtkmm.h>
#include <libglademm.h>
#include "chatview.h"
#include "chatlist.h"
#include "memberlist.h"
#include "../general/channel.h"
#include "../general/communicate.h"

/// Window to show the chat conversation

class chat_window : public Gtk::Window {
  private:
    std::string cuser;
  public:
	chat_window(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> refGlade);
	virtual ~chat_window();
	Glib::RefPtr<Gtk::TextBuffer> buffer;
	Gtk::Notebook* chat_book;
	memberlist *members;

  protected:
	Glib::RefPtr<Gnome::Glade::Xml> m_refGlade;
	Gtk::Entry* chat_entry;
	virtual void finished_entry();
	Glib::SignalTimeout* timeout;
	channel *chan;
   	chatlist *chanlist;
	Gtk::CheckMenuItem* chat_busy;
	virtual void busy_toggle();
	Gtk::MenuItem* chat_autoreply;
	virtual void autoreply_select();
	virtual void do_autoreply(std::string text);
	Gtk::MenuItem* chat_memberlist;
	virtual void memberlist_select();
	Gtk::MenuItem* chat_channellist;
	virtual void channellist_select();
	Gtk::MenuItem* chat_joinchannel;
	virtual void joinchannel_select();
	virtual void do_joinchannel(std::string text);
	Gtk::MenuItem* chat_quit;
	virtual void quit_select();
	Gtk::MenuItem* chat_descr;
	virtual void descr_select();
	virtual void do_title(std::string text);
	Gtk::CheckMenuItem* chat_private;
	virtual void do_open();
	virtual void do_invitation();
	virtual void do_private();
	virtual void private_toggle();
	Gtk::CheckMenuItem* chat_invitation;
	virtual void invitation_toggle();
	Gtk::MenuItem* chat_passwd;
	virtual void passwd_select();
	virtual void do_passwd(std::string text);
	Gtk::CheckMenuItem* chat_silence;
	virtual void silence_toggle();
	Gtk::MenuItem* chat_invite;
	virtual void invite_select();
	Gtk::Menu* context_menu;
	virtual void open_context_menu(GdkEventButton* event);
	Gtk::MenuItem* chat_memberlabel;
	Gtk::CheckMenuItem* chat_ignore;
	virtual void ignore_toggle();
	Gtk::MenuItem* chat_whisper;
	virtual void whisper_select();
	virtual void do_whisper(std::string text);
	Gtk::MenuItem* chat_kick;
	virtual void kick_select();
	Gtk::CheckMenuItem* chat_mute;
	virtual void mute_toggle();
	Gtk::CheckMenuItem* chat_moderator;
	virtual void moderator_toggle();
	Gtk::CheckMenuItem* chat_leader;
	virtual void leader_toggle();
	virtual void do_leader();
	virtual void handler(channel *ch);
	virtual void define_text(std::string tab_name);
	virtual void switch_page(GtkNotebookPage* widget, guint page);
};

#endif //CHAT_WINDOW_H
